/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package eu.fsiebert.polytech.db.mediatheque.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Florent
 */
@Entity
@Table(name = "Config")
@NamedQueries({
    @NamedQuery(name = "Config.findAll", query = "SELECT c FROM Config c"),
    @NamedQuery(name = "Config.findByConfigName", query = "SELECT c FROM Config c WHERE c.configName = :configName"),
    @NamedQuery(name = "Config.findByNbMaxItemEmpruntable", query = "SELECT c FROM Config c WHERE c.nbMaxItemEmpruntable = :nbMaxItemEmpruntable"),
    @NamedQuery(name = "Config.findByDureeMiseADisposition", query = "SELECT c FROM Config c WHERE c.dureeMiseADisposition = :dureeMiseADisposition"),
    @NamedQuery(name = "Config.findByMontantPenaliteParJour", query = "SELECT c FROM Config c WHERE c.montantPenaliteParJour = :montantPenaliteParJour"),
    @NamedQuery(name = "Config.findByMontantBaseAdhesion", query = "SELECT c FROM Config c WHERE c.montantBaseAdhesion = :montantBaseAdhesion")})
public class Config implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "ConfigName", nullable = false, length = 255)
    private String configName;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NbMaxItemEmpruntable", nullable = false)
    private int nbMaxItemEmpruntable;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DureeMiseADisposition", nullable = false)
    private int dureeMiseADisposition;
    @Basic(optional = false)
    @NotNull
    @Column(name = "MontantPenaliteParJour", nullable = false)
    private float montantPenaliteParJour;
    @Basic(optional = false)
    @NotNull
    @Column(name = "MontantBaseAdhesion", nullable = false)
    private float montantBaseAdhesion;

    public Config() {
    }

    public Config(String configName) {
        this.configName = configName;
    }

    public Config(String configName, int nbMaxItemEmpruntable, int dureeMiseADisposition, float montantPenaliteParJour, float montantBaseAdhesion) {
        this.configName = configName;
        this.nbMaxItemEmpruntable = nbMaxItemEmpruntable;
        this.dureeMiseADisposition = dureeMiseADisposition;
        this.montantPenaliteParJour = montantPenaliteParJour;
        this.montantBaseAdhesion = montantBaseAdhesion;
    }

    public String getConfigName() {
        return configName;
    }

    public void setConfigName(String configName) {
        this.configName = configName;
    }

    public int getNbMaxItemEmpruntable() {
        return nbMaxItemEmpruntable;
    }

    public void setNbMaxItemEmpruntable(int nbMaxItemEmpruntable) {
        this.nbMaxItemEmpruntable = nbMaxItemEmpruntable;
    }

    public int getDureeMiseADisposition() {
        return dureeMiseADisposition;
    }

    public void setDureeMiseADisposition(int dureeMiseADisposition) {
        this.dureeMiseADisposition = dureeMiseADisposition;
    }

    public float getMontantPenaliteParJour() {
        return montantPenaliteParJour;
    }

    public void setMontantPenaliteParJour(float montantPenaliteParJour) {
        this.montantPenaliteParJour = montantPenaliteParJour;
    }

    public float getMontantBaseAdhesion() {
        return montantBaseAdhesion;
    }

    public void setMontantBaseAdhesion(float montantBaseAdhesion) {
        this.montantBaseAdhesion = montantBaseAdhesion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (configName != null ? configName.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Config)) {
            return false;
        }
        Config other = (Config) object;
        if ((this.configName == null && other.configName != null) || (this.configName != null && !this.configName.equals(other.configName))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "eu.fsiebert.polytech.db.mediatheque.entity.Config[ configName=" + configName + " ]";
    }
    
}
